class EventEmitter extends EventTarget {
  on = this.addEventListener;

  off = this.removeEventListener;

  emit = (type, data) => this.dispatchEvent(new CustomEvent(type, { detail: data }));

  once = (type, listener) => this.on(type, listener, { once: true, capture: true });
}
const eventEmitter: any = new EventEmitter();
export default eventEmitter;
